Label:"Example Demo-the relationship between entities" "The work of logical design" ① the logical model of transforming demand into a database ② the logical model in the form of ER diagrams ③ is independent of the specific DBMS system chosen "Noun explanation" The candida
) Inserting a node can also be as simple as using an adjacency table. You can insert a leaf node without modifying any of the other rows. All you need to do is copy a logical Father node path to the node to be inserted and append the ID of the new node to the end of the path. If this ID is generated by the database when it is inserted, you may need to insert this record first, then get the ID of the record
Label: The goal of this article is to identify an anti-pattern that uses a primary key, but confuses the nature of the primary key. first, establish the primary key specification Everyone who knows the design of the database knows that the primary key is a very important and even necessary part of a table. It is true that the primary key is part of a good database
as using an adjacency table. You can insert a leaf node without modifying any of the other rows. All you need to do is copy a logical Father node path to the node to be inserted and append the ID of the new node to the end of the path. If this ID is generated by the database when it is inserted, you may need to insert this record first, then get the ID of the record and update its path. Disadvantages of P
instead of a column. The overall design is as follows: CREATE TABLEQuestion (QuestionIDintPK, Questionbody Bodynvarchar( -)
)
CREATE TABLEAnswer (AnsweridintPK, Answerbodynvarchar( -), QuestionIDint,
FOREIGN KEY(QuestionID)REFERENCESQuestion (QuestionID)) For the above design, how many answers are no problem, and the addition and deletion of the search and change are simple more than a grade. Actual
Label: Variable attribute requirements: We need to store a lot of appliances in the database, such as TV, refrigerator and so on. Typically, in a program, our class diagram is: Eva Design One way to do this kind of inherited mutable property is to create another table that stores properties as rows. The data stored here looks like this: Such a design is cal
than once in a crosstab, you can cancel the composite primary key. However, it is not possible to ensure that an address is not present in more than one cross-table, which needs to be implemented in our program code.In fact, the Polymorphic Association is related to the entity-attribute-value that was mentioned in the previous article.If the previous use of the class table design, there is no problem at all, the above address, can also rely on invers
Tags: database logical structure design pattern design structureLogical Structure DesignThe task of logical structure designThe basic E-R diagram designed in conceptual structure design phase is converted into a
values, you can consider the sentence to be opened. The open clause should contain an index.
9. SET Showplan_all on to view the execution scenario. DBCC checks database data integrity.
DBCC (DataBase consistency Checker) is a set of programs that verify the integrity of SQL Server databases.
A cursor with caution
In some situations where cursors must be used, consider moving the qualifying data rows in
Label: Some developers do not recommend using integrity constraints, and you may have heard the reasons for not using foreign keys in the following points. 1, the data update has the possibility and the constraint conflict. 2. The current database design is so flexible that referential integrity constraints are not supported. 3. Indexes created by the database fo
Label: I. Introduction to the pattern of disorderly crossing Programmers typically use a comma-delimited list to avoid creating cross-tables in many-to-many relationships, which is defined as an anti-pattern called a disorderly crossing. For example: In a product management system, a person can have multiple products, a product must correspond to a person, so there are the following databases: However, over time, there is a product that may have multiple contacts. So in order to minimally mod
2010-01-02, but the actual release time was slightly early 2009-12-31.You are confidently typing with confidence:UPDATE NEWS2010 SET = ' 2009-12-31 ' WHERE = 12345 At run time, suddenly think, this data becomes an invalid data, it should be deposited in NEWS2009 this table. Update is useless, you must add it to the NEWS2010 and then delete this piece of data. 4. To ensure uniquenessThe split data, whose primary key is unique in the table of all years, if you want to move a piece of data
Principles of SQL statement optimization:
1, use the index to traverse the table faster
The index established by default is not a clustered index, but sometimes it is not optimal. Under a non-clustered index, data is physically stored randomly on a data page. The reasonable index design should be based on the analysis and prediction of various queries. In general: ①. You can consider establishing a clustered index if you have a large number of dupli
An attempt to extract a logical page (1:1640) in database 5 failed. This logical page belongs to allocation unit xxx, not xxx.
article Category: Database This information indicates that the database or table is partially corrupted and can be tried by the following steps:1.
DBCC CHECKDB check still has errors, you can use DBCC CHECKTABLE to fix them. Use the name of the database entity that needs to be repaired
declare @dbname varchar (255)
set @dbname= ' Name of the database to be repaired '
exec sp_dboption @dbname,' single user ', ' true '
DBCC CHECKTABLE (' name of the data table to be repaired ', Repair_allow_ Data_loss)
the name of the inserted table and save the result in a different table INSERT into #HK_STK_PRICE_IDX (LIST_DATE,LTTTRDATE,EDATE,PSVPCLNGPRARC,PSVOPNGPRARC,PSVCLNGPRARC,PSVHTPR, Psvltpr,trvol,trto)SELECTc.list_date,b.edate,a.enddate,b.psvpclngprarc,b.psvopngprarc,b.psvclngprarc,b.psvhtpr,b.psvltpr,b.trvol,b. Trto from#TRADE_DAY A CrossAPPLY (SELECT TOP 1 * from#STK_MKTWHEREEDATEA.enddate andList_datea.enddateORDER byEDATEDESC) B CrossAPPLY (SELECT TOP 1 * from#LIST_DATEWHEREList_dateA.endd
chart, this series of pictures first saw the logo of the brand from the upper left corner, and then the reading trajectory from the phrase in the diagonal vision to the lower right corner of the product, the screen needs to emphasize the elements are in the reading logic of the Law show. The rest of the visual blind spot is the auxiliary element.
2. Straight-line logic
For straight-line logic, my understanding is that Top-down is like a hierarchy of power distribution. As with the industrial
Tags: style from LIS SQL statement modify member Bak level backupWhen you use a statement to restore a database, the following error is reported: Msg 3234, Level 16, State 2, line 29thThe logical file ' lenbormealorder_base_2017 ' is not part of the database ' members_01 '. Please use RESTORE filelistonly to list the logical
Label: Use test
go
ALTER DATABASE test SET single_user
DBCC CHECKDB (test, repair_allow_data_loss) with NO_INFOMSGS
Go
ALTER DATABASE Test SET Multi_user
For a single database error, run this fix not. Then I was able to run it in tempdb. DBCC CHECKDB (' tempdb ') In fact, there was another mistake at the beginning: An attempt to extract a
The related steps about what to create a phisical standby database please REFER:HTTP://BLOG.CSDN.NET/WATERXCFG304/ARTICL e/details/35991771/* How to create a logical standby database based on a physical standby database */Here is the main library:The following statements can be used to check whether a SQL app uniquely
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.